perm filename UPPERC.SAI[LIB,AIL] blob sn#408160 filedate 1979-01-09 generic text, type T, neo UTF8
entry uppercase;
begin "uppercase"
   
define library!entry = true;
require "sys:std.hdr" source!file;

internal simple string procedure uppercase(string x);
begin "uppercase"
   string y;
  
! uppercase returns a copy of argument string with all
  lowercase alphabetics changed to uppercase;

  integer temp;

  y ← null;
  while length(x) > 0 do
  begin "alpha loop"
     temp ← lop(x);
     if (temp geq "a") and (temp leq "z") then
        temp ← temp -'40;
     y ← y & temp;
  end "alpha loop";

  return(y);
end "uppercase";
end "uppercase"